<?php

@session_start();
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
if ($_REQUEST[action] == "post") {
    $key = $_REQUEST[key];
    $value = $_REQUEST[value];
    $_SESSION[$key] = $value;
} else if ($_REQUEST[action] == "get") {
    $key = $_REQUEST[key];
    if (isset($_SESSION[$key])) {
        if ($_SESSION[user] == "") {
            $_SESSION[$key] = 0;
        }
        if (is_array($_SESSION[$key])) {
            print_r($_SESSION[$key]);
        } else {
            echo $_SESSION[$key];
        }
    } else {
        echo 0;
    }
}
header("Content-Type: text/plain");
?>
